@include('admin.common.header')

<!--tab nav start-->
<script>
  var ue = UE.getEditor('editor', {
        autoHeight: false,
    });

   ue.ready(function() {
       ue.setContent('{!!$activity->cost_info!!}');
        $('.form-submit').bind('click', function () {
                var html = ue.getContent();
               var id =$("input[name='id']").val();
                $.ajax({
                    type: 'post',
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    },
                    url: '/admin/activity/update/cost',
                    data: {cost_info:html,id:id},
                    dataType: 'json',
                    success: function(res){
                        console.log(res);
                        layer.msg('修改成功');
                    },
                    error : function () {
                        layer.msg('修改失败');
                    }
                });
        });
    });

</script>
<section class="panel">
    <header class="panel-heading tab-bg-dark-navy-blue ">
        <ul class="nav nav-tabs">
            <li @if ($_active['_action'] == 'list')  class="active" @endif>
                <a href="/admin/activity">活动列表</a>
            </li>
            <li @if ($_active['_action'] == 'cost')  class="active" @endif>
                <a href="/admin/activity/cost">费用说明</a>
            </li>
        </ul>
    </header>
    <div class="panel-body">
        <div class="tab-content">
            <div class="row cmxform form-horizontal tasi-form">
                <div class="col-lg-10">
                    <section class="panel">
                        <div class="panel-body">
                            <div class="form-group ">
                                    <label for="name" class="control-label col-lg-2">费用说明</label>
                                    <div class="col-lg-10">
                                    <input type="hidden" name="id" value="{{$activity->id}}"/>
                                   <div style="width:1000px;height: 350px;" id="editor" name="cost_info"></div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
            <div class="col-lg-12 text-center">
                <button class="btn btn-danger form-submit">提交</button>
            </div>
        </div>
      </div>
</section>
<!--tab nav start-->

@include('admin.common.footer')